<!--
 @description 办事处-销售tab块内容
 @fileName OrderContent.vue
 @author zengqiongying
 @created 2021/06/26 11:17:07
-->
<template>
  <div class="main-page mt10">
    <!-- 销售开单 -->
    <div class="wrapper">
      <div class="main-title" @click.stop="openInstrusction('order','sale_6month')">
        <div style="flex:1;display:flex;align-items: center;">
          销售开单近6月趋势(车)
          <img class="icon_inst" src="@/assets/image/icon_instructions.png">
        </div>
        <div class="ft12 color-99 fw-normal">
          本年总销售：<span class="color-red">{{ yearTotal | filterForamtThousand }}</span>车
        </div>
        <!-- <div class="chart-dot">
                <div class="dot green">今年</div>
                <div class="dot yellow">去年</div>
              </div> -->
      </div>
      <six-month-chart />
    </div>
    <div class="wrapper">
      <div class="main-title" @click.stop="openInstrusction('order','sale_month')">
        当月销售开单趋势(车)
        <img class="icon_inst" src="@/assets/image/icon_instructions.png">
      </div>
      <thirty-day-chart />
    </div>
  </div>
</template>

<script>
import SixMonthChart from './order/SixMonthChart'
import ThirtyDayChart from './order/ThirtyDayChart'
import { parseTime } from '@/utils'
import { getOfficeSaleOrderYearSoQuantity } from '@/apis/sale'
export default {
  name: 'OrdersPageContent',
  components: { SixMonthChart, ThirtyDayChart },
  props: {
    coreDate: {
      type: String,
      default: parseTime(new Date(), '{y}-{m}-{d}')
    }
  },
  data() {
    return {
      provinceName: this.$route.query.provinceName || '',
      yearTotal: 0 // 本年总销售量
    }
  },
  created() {
    this.getTotalCount()
  },
  methods: {
    // 获取年度总量
    getTotalCount() {
      getOfficeSaleOrderYearSoQuantity(this.provinceName).then(res => {
        this.yearTotal = res.data || '-'
      })
    }
  }
}

</script>
<style lang='scss' scoped>
</style>
